package com.SunSoft.PhoneRemoteControl;

import android.content.DialogInterface;
import android.content.DialogInterface.OnKeyListener;
import android.media.AudioManager;
import android.view.KeyEvent;

final class ar
  implements DialogInterface.OnKeyListener
{
  public final boolean onKey(DialogInterface paramDialogInterface, int paramInt, KeyEvent paramKeyEvent)
  {
    if (paramInt == 24)
    {
      MainControl.d(this.a, MainControl.n(this.a).getStreamVolume(3));
      MainControl.e(this.a, MainControl.t(this.a));
      paramDialogInterface = this.a;
      MainControl.e(paramDialogInterface, MainControl.u(paramDialogInterface) + 1);
      if (MainControl.u(this.a) > MainControl.u(this.a))
        MainControl.e(this.a, MainControl.v(this.a));
      if ((MainControl.u(this.a) < MainControl.v(this.a) - 1) && (!(MainControl.k)))
        MainControl.e(this.a, MainControl.v(this.a) - 1);
      MainControl.n(this.a).setStreamVolume(3, MainControl.u(this.a), 1);
      MainControl.d(this.a).a("save_vol", String.valueOf(MainControl.u(this.a)));
      MainControl.a("Test", "currentVolume:" + String.valueOf(MainControl.t(this.a)));
      MainControl.a(this.a);
      return true;
    }
    if (paramInt == 25)
    {
      MainControl.d(this.a, MainControl.n(this.a).getStreamVolume(3));
      MainControl.e(this.a, MainControl.t(this.a));
      paramDialogInterface = this.a;
      MainControl.e(paramDialogInterface, MainControl.u(paramDialogInterface) - 1);
      if (MainControl.u(this.a) <= 2)
        MainControl.e(this.a, 2);
      if ((MainControl.u(this.a) < MainControl.v(this.a) - 1) && (!(MainControl.k)))
        MainControl.e(this.a, MainControl.v(this.a) - 1);
      MainControl.n(this.a).setStreamVolume(3, MainControl.u(this.a), 1);
      MainControl.d(this.a).a("save_vol", String.valueOf(MainControl.u(this.a)));
      MainControl.a("Test", "currentVolume:" + String.valueOf(MainControl.t(this.a)));
      MainControl.a(this.a);
      return true;
    }
    return false;
  }
}